Skip to contentSkip to conversation

Xen on ARM: create multiple guests from device tree

GSoC Luca Miccio 3 participants 18 messages Mar 21, 2017 – Mar 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,
I'm an undergraduate student from the Computer Science Bachelor's Degree of the University of Modena and Reggio Emilia (Italy).

I'm very interested in the "Xen on ARM: create multiple guests from device tree" project.
A year ago I started a project on the "Hikey" board with the Android operating system in order to integrate BFQ - which is a proportional-share storage-I/O scheduler - in it improving the device performances. Now the project is still in development and it is supervised by my professor which, also, told me about GSoC. Since I studied the C language for a full year at university and I already had to deal with kernel-stuffs, cross-compiling and so on, I chose this project.

Since I'm not very familiar with the "device tree" notion, I'm wondering if you could give me some suggestions on where I could start from.

The first thing I will do is to install xen and start to familiarize with it. Any advice regarding this project will be really appreciated.

Best regards,

Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#1 lore raw
Quoted 13 lines · Luca Miccio

Hi,
I'm an undergraduate student from the Computer Science Bachelor's Degree of the University of Modena and Reggio Emilia (Italy).

I'm very interested in the "Xen on ARM: create multiple guests from device tree" project.
A year ago I started a project on the "Hikey" board with the Android operating system in order to integrate BFQ - which is a proportional-share storage-I/O scheduler - in it  improving the device performances. Now the project is still in development and it is supervised by my professor which, also, told me about GSoC. Since I studied the C language for a full year at university and I already had to deal with kernel-stuffs, cross-compiling and so on, I chose this project.

Quoted 5 lines

Since I'm not very familiar with the "device tree" notion, I'm wondering if you could give me some suggestions on where I could start from.

The first thing I will do is to install xen and start to familiarize with it. Any advice regarding this project will be really appreciated.

Hello Luca,

Thanks for your interest in Xen on ARM! Like you wrote, I would start by compiling Xen from source and installing it on your board. The HiKey is a decent option, but it can be difficult to work with if you don't have serial access. I know that uart connectors for the HiKey are sold separetely:

http://www.96boards.org/product/uarts/

Otherwise, you could use the ARMv8 Foundation Platform, which is a free (as in beer) software emulator:

https://developer.arm.com/products/system-design/fixed-virtual-platforms
https://community.arm.com/processors/b/blog/posts/virtualization-on-arm-with-xen

Unfortunately all our guides on installing Xen on the Foundation Model are outdated, but I know that Andre (CC'ed) is using it for development. He should be able to help you if you run into any issues.

After you complete the setup of the building and testing environments, the next thing to do is getting familiar with the code. The best way to do that is by fixing any of the bugs or implementing any of the features on the Xen Project Tracker:

https://xenproject.atlassian.net/projects/XEN/issues

Most of the items listed are large projects, but some of them are pretty small, small enough to be a starting point. For example XEN-29 (Add -fstack-protector support to the hypervisor), or XEN-10 (Clean target makefile should remove all temporary for every architecture).

Cheers,

Stefano

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw

Hi Stefano,

2017-03-21 21:36 GMT+01:00 Stefano Stabellini <[email protected]>:

Quoted 30 lines · Luca Miccio
Quoted 5 lines

Hi,
I'm an undergraduate student from the Computer Science Bachelor's Degree of the University of Modena and Reggio Emilia (Italy).

I'm very interested in the "Xen on ARM: create multiple guests from

device tree"

Quoted 2 lines

project.
A year ago I started a project on the "Hikey" board with the Android

operating

Quoted 1 line

system in order to integrate BFQ - which is a proportional-share

storage-I/O

Quoted 1 line

scheduler - in it improving the device performances. Now the project is

still in

Quoted 1 line

development and it is supervised by my professor which, also, told me

about GSoC.

Quoted 1 line

Since I studied the C language for a full year at university and I

already had to deal

Quoted 3 lines

with kernel-stuffs, cross-compiling and so on, I chose this project.

Since I'm not very familiar with the "device tree" notion, I'm wondering

if you could give me

Quoted 3 lines

some suggestions on where I could start from.

The first thing I will do is to install xen and start to familiarize

with it.

Quoted 1 line

Any advice regarding this project will be really appreciated.

Hello Luca,

Quoted 8 lines

Thanks for your interest in Xen on ARM! Like you wrote, I would start by compiling Xen from source and installing it on your board. The HiKey is a decent option, but it can be difficult to work with if you don't have serial access. I know that uart connectors for the HiKey are sold separetely:

http://www.96boards.org/product/uarts/

Otherwise, you could use the ARMv8 Foundation Platform, which is a

Quoted 7 lines

free (as in beer) software emulator:

https://developer.arm.com/products/system-design/fixed-virtual-platforms
https://community.arm.com/processors/b/blog/posts/
virtualization-on-arm-with-xen

I chose this option for now

Unfortunately all our guides on installing Xen on the Foundation Model

Quoted 3 lines

are outdated, but I know that Andre (CC'ed) is using it for development. He should be able to help you if you run into any issues.

I tried to install and setting up xen with the blog post that you have mentioned
above and i have some issues when compiling the boot wrapper with the git repository provided in the post.

In particular i get this error when executing this command:

$ make CROSS_COMPILE=aarch64-linux-gnu- FDT_SRC=foundation-v8.dts
IMAGE=xen-system.axf

This is the error i get:

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000 -DUART_BASE=0x1c090000 -DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000 -DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8 -DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000 -DUART_BASE=0x1c090000 -DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000 -DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8 -DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.lds model.lds.S
aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff] Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I booted correctly a different kernel image with another .axf file only to test the Foundation Model
and it worked with no problems.

It maybe be helpful my toolchain version:
aarch64-linux-gnu-gcc (Debian 6.3.0-9) 6.3.0 20170316

I am using all the file provided by the post at the link ( in particular the Foundation-v8.dts file):
https://community.arm.com/cfs-file/__key/telligent-evolution-components-attachments/01-2142-00-00-00-00-89-21/2972.zip

If you need any type of information, please ask.

However I have correctly compiled xen from source on my laptop and i am trying to become familiar with the hypervisor itself.

Quoted 6 lines

After you complete the setup of the building and testing environments, the next thing to do is getting familiar with the code. The best way to do that is by fixing any of the bugs or implementing any of the features on the Xen Project Tracker:

Quoted 8 lines

https://xenproject.atlassian.net/projects/XEN/issues

Most of the items listed are large projects, but some of them are pretty small, small enough to be a starting point. For example XEN-29 (Add -fstack-protector support to the hypervisor), or XEN-10 (Clean target makefile should remove all temporary for every architecture).

I took a look at the list and i have already fixed the XEN-10 task. If

it's not a problem i
would submit the patch for this small fix, while i am figuring out how to solve my compilation
issue described above.

Cheers,

Quoted 2 lines

Stefano

Best regards,

Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
Quoted 1 line · Luca Miccio

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

[...]

Quoted 5 lines

I took a look at the list and i have already fixed the XEN-10 task. If it's not a problem i
would submit the patch for this small fix, while i am figuring out how to solve my compilation
issue described above.

I am fine if you send the patch now. XEN-10 is a build system modifications that will not impact the Xen binary.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#4 lore raw

Hi Luca,

please don't use HTML emails.

Quoted 50 lines · Julien Grall
Quoted 1 line · Luca Miccio

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

Hi Stefano and Julien,

Quoted 7 lines

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

Quoted 63 lines · Julien Grall
Quoted 50 lines · Luca Miccio
Quoted 1 line

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Quoted 6 lines

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:

$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel
( I am using the staging branch)

- Get the linux source with git:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

- Compile the linux kernel with the toolchain:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:

$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

Thank you,
Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#6 lore raw
Quoted 104 lines · Luca Miccio

Hi Stefano and Julien,

Quoted 7 lines

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

Quoted 63 lines · Julien Grall
Quoted 50 lines · Luca Miccio
Quoted 1 line

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Quoted 6 lines

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:

$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel
( I am using the staging branch)

- Get the linux source with git:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

Quoted 6 lines

- Compile the linux kernel with the toolchain:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:

$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

Try removing --cores=4, does it work?

Quoted 10 lines

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

Thank you,
Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#7 lore raw
Quoted 108 lines

Il giorno 23 mar 2017, alle ore 01:27, Stefano Stabellini <[email protected]> ha scritto:

Quoted 104 lines · Luca Miccio

Hi Stefano and Julien,

Quoted 7 lines

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

Quoted 63 lines · Julien Grall
Quoted 50 lines · Luca Miccio
Quoted 1 line

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Quoted 6 lines

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:

$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel
( I am using the staging branch)

- Get the linux source with git:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

Quoted 9 lines
Quoted 6 lines

- Compile the linux kernel with the toolchain:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:

$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

Try removing --cores=4, does it work?

I have already tried this option with no results

Quoted 10 lines
Quoted 10 lines

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

Thank you,
Luca

Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw
Quoted 110 lines · Luca Miccio
Quoted 110 lines

Il giorno 23 mar 2017, alle ore 01:27, Stefano Stabellini <[email protected]> ha scritto:

Quoted 107 lines · Luca Miccio

Hi Stefano and Julien,

Quoted 7 lines

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

Quoted 63 lines · Julien Grall
Quoted 50 lines · Luca Miccio
Quoted 1 line

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Quoted 6 lines

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:

$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel
( I am using the staging branch)

- Get the linux source with git:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

- Compile the linux kernel with the toolchain:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:

$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

Try removing --cores=4, does it work?

I have already tried this option with no results

The problem is that no matter the --cores=4 option, the device tree (foundation-v8.dtb) has 4 cpu cores by default. It also says that the "enable-method" is "spin-table". At the same time Julien wrote to pass --enable-psci to the bootwrapper, which is a different way to start secondary cpus. I am guessing that is the problem. I suggest to change boot method to psci, to do that you need to modify the dts (device tree source), see the attached patch for Linux. Then you can rebuild the dtb (device tree binary) with:

make dtbs

Finally rebuild again the bootwrapper and run the model with --cores 4.

For me, that works. Great way to get familiar with device tree ;-)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

arch/arm64/boot/dts/arm/foundation-v8.dtsi +4 -4
index 7cfa8e4..daf2aab 100644
@@ -32,7 +32,7 @@
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x0>;
-			enable-method = "spin-table";
+			enable-method = "psci";
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
@@ -40,7 +40,7 @@
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x1>;
-			enable-method = "spin-table";
+			enable-method = "psci";
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
@@ -48,7 +48,7 @@
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x2>;
-			enable-method = "spin-table";
+			enable-method = "psci";
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};
@@ -56,7 +56,7 @@
 			device_type = "cpu";
 			compatible = "arm,armv8";
 			reg = <0x0 0x3>;
-			enable-method = "spin-table";
+			enable-method = "psci";
 			cpu-release-addr = <0x0 0x8000fff8>;
 			next-level-cache = <&L2_0>;
 		};

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#9 lore raw
Quoted 131 lines

Il giorno 23 mar 2017, alle ore 01:55, Stefano Stabellini <[email protected]> ha scritto:

Quoted 110 lines · Luca Miccio
Quoted 110 lines

Il giorno 23 mar 2017, alle ore 01:27, Stefano Stabellini <[email protected]> ha scritto:

Quoted 107 lines · Luca Miccio

Hi Stefano and Julien,

Quoted 7 lines

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

Quoted 63 lines · Julien Grall
Quoted 50 lines · Luca Miccio
Quoted 1 line

Hi Stefano,

Hello Luca,

Quoted 21 lines

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000
-DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image
-DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S

aarch64-linux-gnu-gcc -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000

(quoted diff) +0 -2
-DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000
-DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S

aarch64-linux-gnu-gcc -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8

(quoted diff) +0 -3
-DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000
-DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E
-P -C -o model.lds model.lds.S

aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Quoted 2 lines

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

Quoted 8 lines

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Quoted 6 lines

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:

$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel
( I am using the staging branch)

- Get the linux source with git:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

- Compile the linux kernel with the toolchain:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:

$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

Try removing --cores=4, does it work?

I have already tried this option with no results

The problem is that no matter the --cores=4 option, the device tree (foundation-v8.dtb) has 4 cpu cores by default. It also says that the "enable-method" is "spin-table". At the same time Julien wrote to pass --enable-psci to the bootwrapper, which is a different way to start secondary cpus. I am guessing that is the problem. I suggest to change boot method to psci, to do that you need to modify the dts (device tree source), see the attached patch for Linux. Then you can rebuild the dtb (device tree binary) with:

Quoted 5 lines

make dtbs

Finally rebuild again the bootwrapper and run the model with --cores 4.

For me, that works. Great way to get familiar with device tree ;-)

I tried also this method but i had the same error. So i came up with the idea of removing the psci method from the configure and also from the dtsi file that i have changed.

With this configuration the model booted up correctly, even if the process took about 10 minutes. Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Thank you for your response,
Luca

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/ <https://cloud-images.ubuntu.com/releases/16.04/release/>

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

<1.txt>

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#10 lore raw

Hello Luca,

Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

I guess you are using only 1 core in this case. Am I right?

Quoted 5 lines

With this configuration the model booted up correctly, even if the process took about 10 minutes.
Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Booting a full distro on the model can be slow. Usually I write my own initscript to start the necessary daemon and skip systemd.

42sh> cat /root/init.sh

set -x
mount -t proc proc /proc
mount -t devtmpfs dev /dev

export HOME=/root

rm -rf /var/run/xenstore
rm -rf /var/run/xen

/etc/init.d/xencommons start

exec /bin/bash

-------------------

And I pass init=/root/init.sh on the Linux kernel command line.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#11 lore raw

Hello Julien

Quoted 4 lines

Il giorno 23 mar 2017, alle ore 15:49, Julien Grall <[email protected]> ha scritto:

Hello Luca,

Quoted 8 lines
Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

I guess you are using only 1 core in this case. Am I right?

No, i am using 4 cores, with —cores option and i think that i am using actually 4 cores because on the model “control panel” i have 4 green triangles which ones of them should represent the number of cores and their status.
It is only my opinion so, please, tell me if i am wrong.

Quoted 19 lines
Quoted 5 lines

With this configuration the model booted up correctly, even if the process took about 10 minutes.
Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Booting a full distro on the model can be slow. Usually I write my own initscript to start the necessary daemon and skip systemd.

42sh> cat /root/init.sh

set -x
mount -t proc proc /proc
mount -t devtmpfs dev /dev

export HOME=/root

rm -rf /var/run/xenstore
rm -rf /var/run/xen

Quoted 8 lines

/etc/init.d/xencommons start

exec /bin/bash

-------------------

And I pass init=/root/init.sh on the Linux kernel command line.

That helped a lot, thank you.

Quoted 4 lines

Cheers,

Signature · 1 line
Julien Grall

Luca.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#12 lore raw

Hello Luca,

did you manage to make any progress on the number of cores exposed by the model?

Thank you for the Makefile patch! If you have time, I encourage you to fix one of the other small outstanding bugs, for example XEN-20 or XEN-11 (just the ability to load a Dom0 kernel bigger than 128MB or just the ability to parse the new image_size field introduced in Linux 3.17).

Finally, I would like to remind you of the upcoming deadline for applications submissions, which is the 3rd of April for GSoC, see:

http://marc.info/?l=xen-devel&m=149071502330534

The GSoC application system is
https://summerofcode.withgoogle.com/get-started/.

Please give a look at the Xen Project application template here:

https://wiki.xenproject.org/wiki/GSoC_Student_Application_Template

It also includes an "Implementation Plan", where you have the chance to explain the implementation plan for the project you would like to apply for.

Thanks,

Stefano

Quoted 44 lines · Luca Miccio

Hello Julien

Quoted 4 lines

Il giorno 23 mar 2017, alle ore 15:49, Julien Grall <[email protected]> ha scritto:

Hello Luca,

Quoted 8 lines
Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

I guess you are using only 1 core in this case. Am I right?

No, i am using 4 cores, with —cores option and i think that i am using actually 4 cores because on the model “control panel” i have 4 green triangles which ones of them should represent the number of cores and their status.
It is only my opinion so, please, tell me if i am wrong.

Quoted 19 lines
Quoted 5 lines

With this configuration the model booted up correctly, even if the process took about 10 minutes.
Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Booting a full distro on the model can be slow. Usually I write my own initscript to start the necessary daemon and skip systemd.

42sh> cat /root/init.sh

set -x
mount -t proc proc /proc
mount -t devtmpfs dev /dev

export HOME=/root

rm -rf /var/run/xenstore
rm -rf /var/run/xen

Quoted 8 lines

/etc/init.d/xencommons start

exec /bin/bash

-------------------

And I pass init=/root/init.sh on the Linux kernel command line.

Quoted 8 lines

That helped a lot, thank you.

Quoted 4 lines

Cheers,

Signature · 1 line
Julien Grall

Luca.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#13 lore raw
Quoted 17 lines · Stefano Stabellini

Hello Luca,

did you manage to make any progress on the number of cores exposed by the model?

Thank you for the Makefile patch! If you have time, I encourage you to fix one of the other small outstanding bugs, for example XEN-20 or XEN-11 (just the ability to load a Dom0 kernel bigger than 128MB or just the ability to parse the new image_size field introduced in Linux 3.17).

Finally, I would like to remind you of the upcoming deadline for applications submissions, which is the 3rd of April for GSoC, see:

http://marc.info/?l=xen-devel&m=149071502330534

The GSoC application system is
https://summerofcode.withgoogle.com/get-started/.

Quoted 7 lines

Please give a look at the Xen Project application template here:

https://wiki.xenproject.org/wiki/GSoC_Student_Application_Template

It also includes an "Implementation Plan", where you have the chance to explain the implementation plan for the project you would like to apply for.

FYI I added some more information on this project here:
http://marc.info/?l=xen-devel&m=149074542307880

Quoted 46 lines · Luca Miccio
Quoted 44 lines

Hello Julien

Quoted 4 lines

Il giorno 23 mar 2017, alle ore 15:49, Julien Grall <[email protected]> ha scritto:

Hello Luca,

Quoted 8 lines
Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

I guess you are using only 1 core in this case. Am I right?

No, i am using 4 cores, with —cores option and i think that i am using actually 4 cores because on the model “control panel” i have 4 green triangles which ones of them should represent the number of cores and their status.
It is only my opinion so, please, tell me if i am wrong.

Quoted 27 lines
Quoted 5 lines

With this configuration the model booted up correctly, even if the process took about 10 minutes.
Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Booting a full distro on the model can be slow. Usually I write my own initscript to start the necessary daemon and skip systemd.

42sh> cat /root/init.sh

set -x
mount -t proc proc /proc
mount -t devtmpfs dev /dev

export HOME=/root

rm -rf /var/run/xenstore
rm -rf /var/run/xen

/etc/init.d/xencommons start

exec /bin/bash

-------------------

And I pass init=/root/init.sh on the Linux kernel command line.

Quoted 8 lines
Quoted 8 lines

That helped a lot, thank you.

Quoted 4 lines

Cheers,

Signature · 1 line
Julien Grall

Luca.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#14 lore raw

Hi Stefano,
sorry if i am so late but my schedule was full this week. I am currently preparing a presentation for an event here in Italy and i had no time to check even my emails.

Quoted 7 lines

Il giorno 29 mar 2017, alle ore 02:13, Stefano Stabellini <[email protected]> ha scritto:

Quoted 4 lines · Stefano Stabellini

Hello Luca,

did you manage to make any progress on the number of cores exposed by the model?

I am still not using the psci and the XEN console says that he is bringing up all the 4 CPUs.

Quoted 5 lines
Quoted 5 lines

Thank you for the Makefile patch! If you have time, I encourage you to fix one of the other small outstanding bugs, for example XEN-20 or XEN-11 (just the ability to load a Dom0 kernel bigger than 128MB or just the ability to parse the new image_size field introduced in Linux 3.17).

I will try to give it a look this weekend but i am not sure to have the time to make e fix soon.

Quoted 10 lines
Quoted 10 lines

Finally, I would like to remind you of the upcoming deadline for applications submissions, which is the 3rd of April for GSoC, see:

http://marc.info/?l=xen-devel&m=149071502330534

The GSoC application system is
https://summerofcode.withgoogle.com/get-started/.

Please give a look at the Xen Project application template here:

Quoted 9 lines
Quoted 5 lines

https://wiki.xenproject.org/wiki/GSoC_Student_Application_Template

It also includes an "Implementation Plan", where you have the chance to explain the implementation plan for the project you would like to apply for.

FYI I added some more information on this project here:
http://marc.info/?l=xen-devel&m=149074542307880 <http://marc.info/?l=xen-devel&m=149074542307880>

Thank you for all the information. Unfortunately I have not considered all of my personal deadlines before attempting to approach this project. It was my mistake. Anyway I will try with all my strength to fill up the application this weekend and try to submit it anyway. I like the Xen project, and even if I will not be chosen for this task, surely I will continue to support and follow it diligently.

Quoted 47 lines
Quoted 47 lines · Luca Miccio
Quoted 44 lines

Hello Julien

Quoted 4 lines

Il giorno 23 mar 2017, alle ore 15:49, Julien Grall <[email protected]> ha scritto:

Hello Luca,

Quoted 8 lines
Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

I guess you are using only 1 core in this case. Am I right?

No, i am using 4 cores, with —cores option and i think that i am using actually 4 cores because on the model “control panel” i have 4 green triangles which ones of them should represent the number of cores and their status.
It is only my opinion so, please, tell me if i am wrong.

Quoted 27 lines
Quoted 5 lines

With this configuration the model booted up correctly, even if the process took about 10 minutes.
Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Booting a full distro on the model can be slow. Usually I write my own initscript to start the necessary daemon and skip systemd.

42sh> cat /root/init.sh

set -x
mount -t proc proc /proc
mount -t devtmpfs dev /dev

export HOME=/root

rm -rf /var/run/xenstore
rm -rf /var/run/xen

/etc/init.d/xencommons start

exec /bin/bash

-------------------

And I pass init=/root/init.sh on the Linux kernel command line.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

That helped a lot, thank you.

Quoted 4 lines

Cheers,

Signature · 1 line
Julien Grall

Luca.

Thank you,
Luca

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#15 lore raw
In reply to Luca Miccio

Hi Luca,

Quoted 11 lines · Luca Miccio

Hello Julien

Quoted 10 lines

Il giorno 23 mar 2017, alle ore 15:49, Julien Grall <[email protected]> ha scritto:

Hello Luca,

Quoted 4 lines · Luca Miccio

I tried also this method but i had the same error. So i came up with the idea of removing the
psci method from the configure and also from the dtsi file that i have changed.

Quoted 6 lines
Quoted 2 lines

I guess you are using only 1 core in this case. Am I right?

No, i am using 4 cores, with —cores option and i think that i am using actually 4 cores because on the model “control panel” i have 4 green triangles which ones of them should represent the number of cores and their status.
It is only my opinion so, please, tell me if i am wrong.

Sorry by "I guess you are using only 1 core" I meant Xen will only bring up one care if you drop the PSCI method. You can find in the log the number of CPUs brought by Xen (see "Brought up N CPUs".

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#16 lore raw
In reply to Luca Miccio

You are still using HTML emails

Quoted 156 lines · Luca Miccio

Il giorno 23 mar 2017, alle ore 01:55, Stefano Stabellini <[email protected]> ha scritto:

On Thu, 23 Mar 2017, Luca Miccio wrote:
Il giorno 23 mar 2017, alle ore 01:27, Stefano Stabellini <[email protected]> ha scritto:

On Thu, 23 Mar 2017, Luca Miccio wrote:
Hi Stefano and Julien,

Il giorno 22 mar 2017, alle ore 22:38, Stefano Stabellini <[email protected]> ha scritto:

Hi Luca,

please don't use HTML emails.

Sorry for that.

On Wed, 22 Mar 2017, Julien Grall wrote:
On 22/03/2017 19:45, Luca Miccio wrote:
Hi Stefano,

Hello Luca,

aarch64-linux-gnu-gcc  -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000 -DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000 -DGIC_CPU_BASE=0x2c002000 -c -o boot.xen.o boot.S -DXEN aarch64-linux-gnu-gcc  -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8 -DBOOT=boot.xen.o -DXEN_OFFSET=0xA00000 -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DXEN=Xen -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.xen.lds model.lds.S aarch64-linux-gnu-gcc  -DCNTFRQ=0x01800000-DUART_BASE=0x1c090000 -DSYSREGS_BASE=0x1c010000 -DGIC_DIST_BASE=0x2c001000 -DGIC_CPU_BASE=0x2c002000 -c -o boot.o boot.S aarch64-linux-gnu-gcc  -DPHYS_OFFSET=0x80000000 -DMBOX_OFFSET=0xfff8 -DBOOT=boot.o -DKERNEL_OFFSET=0x80000 -DFDT_OFFSET=0x08000000 -DFS_OFFSET=0x10000000 -DKERNEL=Image -DFILESYSTEM=filesystem.cpio.gz -E -P -C -o model.lds model.lds.S
aarch64-linux-gnu-ld -o xen-system.axf --script=model.xen.lds
aarch64-linux-gnu-ld: section .xen LMA [0000000080a00000,0000000080ac814f] overlaps section .kernel LMA [0000000080080000,0000000080f009ff]
Makefile:78: set di istruzioni per l'obiettivo "xen-system.axf" non riuscito
make: *** [xen-system.axf] Errore 1\

Clearly there is a problem with the offset of xen section but i can't figure out how to solve it.

I would recommend to use the latest version of bootwrapper which is now including support for Xen. I haven't yet updated the wiki with the runes but here a quick summary of the step I am using:

* Building bootwrapper

42sh> git clone git://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
42sh> autoreconf -i
42sh> ./configure --host=aarch64-linux-gnu --with-kernel-dir=<kernel-dir> --with-dtb=<dtb> \
--with-cmdline="console=hvc0 earlycon=pl011,0x1c090000 root=/dev/vda rw" --enable-psci \
--with-xen-cmdline="dtuart=serial0 console=dtuart no-bootscrub dom0_mem=512M" \
--with-xen=<xen-bin> --with-cpu-ids=0,1,2,3
42sh> make

Where:
* <kernel-dir> is the path to the kernel repository
* <dtb> is the path to the device-tree. I am using the one shipped with Linux in arch/arm64/boot/dts/arm/foundation-armv8.dtbs
 It will be built if you did make all in Linux
* <xen-bin> is the path to Xen binary (xen/xen in the repo)

* Command line for the foundation model
42sh> Foundation_Platform --image=<image> --block-device=<rootfs> --cores=4

Where:
* <image> is the path to xen-system.axf produced by bootwrapper
* <rootfs> is the patch to your rootfs

Let me know if you need more details.

Thanks Julien, I successfully booted Xen and Linux following these steps. I quickly updated the wiki.

Luca, I took me a while to figure out that for root=/dev/vda to work properly, Linux requires not just all the filesystem and virtio options enabled in the kernel config, but also CONFIG_VIRTIO_MMIO=y. With that, you should be able to boot Xen, Linux and mount the root filesystem. If you download one of the Ubuntu arm64 cloud images, the root device will be /dev/vda1.

First of all, thank you for your help.

I think that i keep on doing somenthing wrong because now the bootwrapper produces with no errors the xen-system.axf  with the configuration that Julien provided. But when i launch the emulator it simply stops at:
(XEN) Bringing up CPU1

To help you understand, this is what i have done:
- First i compiled the xen source with the following command:
$ make dist-xen XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CONFIG_EARLY_PRINT=fastmodel ( I am using the staging branch)

- Get the linux source with git:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

-Checkout on the v4.4 branch

- Follow the steps described in the blog and, as you said, i set in my .config file:
CONFIG_VIRTIO=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_BLK=y
I also checked all the filesystem and virtio options.

- Compile the linux kernel with the toolchain:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all (to get also the .dtb file)

- Configured the bootwrapper with the command that Julian wrote and then launched the foundation model with the simple command:
$ Foundation_Platform --image=/path/to/the/xen-system.axf --block-device=xenial-server-cloudimg-arm64.img --cores=4

Try removing --cores=4, does it work?

I have already tried this option with no results

The problem is that no matter the --cores=4 option, the device tree (foundation-v8.dtb) has 4 cpu cores by default. It also says that the "enable-method" is "spin-table". At the same time Julien wrote to pass --enable-psci to the bootwrapper, which is a different way to start secondary cpus. I am guessing that is the problem. I suggest to change boot method to psci, to do that you need to modify the dts (device tree source), see the attached patch for Linux. Then you can rebuild the dtb (device tree binary) with:

make dtbs

Finally rebuild again the bootwrapper and run the model with --cores 4.

For me, that works. Great way to get familiar with device tree ;-)

I tried also this method but i had the same error. So i came up with the idea of removing the psci method from the configure and also from the dtsi file that i have changed.

With this configuration the model booted up correctly, even if the process took about 10 minutes. Just for my personal knowledge: it is normal that the boot is very slow? Is the rootfs that i’m using?

Thank you for your response,
Luca

Quoted 13 lines

The image was downloaded at : https://cloud-images.ubuntu.com/releases/16.04/release/

But, as I said, the emulator blocks at boot. I tried different rootfs images and i have configured the root device properly to /dev/vda1.

Maybe my kernel configuration is wrong?

<1.txt>

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#17 lore raw
In reply to Stefano Stabellini

Hi Stefano,

Quoted 8 lines · Stefano Stabellini

The problem is that no matter the --cores=4 option, the device tree (foundation-v8.dtb) has 4 cpu cores by default. It also says that the "enable-method" is "spin-table". At the same time Julien wrote to pass --enable-psci to the bootwrapper, which is a different way to start secondary cpus. I am guessing that is the problem. I suggest to change boot method to psci, to do that you need to modify the dts (device tree source), see the attached patch for Linux. Then you can rebuild the dtb (device tree binary) with:

I am using --enable-psci and it works for me because bootwrapper is re-writing the CPUs node.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel